<?php
//var_dump($artisname);
?>
<?php $this->load->view('admin/common/pageHead');?>
<?php $this->load->view('admin/common/pageHeader');?>


<div class="fLeft">
	<?php $this->load->view('admin/common/left_nav'); ?>
</div>

<table
	style="border-color: #EAC8B3; border-left: 1px solid #EAC8B3; border-right: 1px solid #EAC8B3; border-style: solid; border-width: 1px;"
	align="center">
	<tbody>
		<tr>
			<td colspan="3" class="fotter-color" align="center"><b>Edit User</b>
			</td>
		</tr>
		<tr>
			<td colspan="3" class="style2" align="left">
				<form name="form1" action="/updateUser" method="post"
					enctype="multipart/form-data" onSubmit="return edituser();">
					<input name="user_id" class="form_input" id="user_id"
						value="<?php echo $userName["user_id"]; ?>" type="hidden">
					<table border="0" cellpadding="0" cellspacing="0" height="25"
						width="550" align="center">
						<tbody>
							<tr>
								<td class="tdclass" width="150">User Name:<span
									style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
								</td>
								<td><input name="userName" class="form_input" id="userName"
									value="<?php echo $userName["name"]; ?>" type="text"></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td class="tdclass" width="150">Address:</td>
								<td><input name="userAddress" class="form_input"
									id="userAddress" value="<?php echo $userName["address"]; ?>"
									type="text"></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td class="tdclass" width="150">City:<span
									style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
								</td>
								<td><input name="City" id="City" class="form_input"
									value="<?php echo $userName["city"]; ?>" type="text"></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
							</tr>
							<tr>

								<td class="tdclass" width="150">State:<span
									style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
								</td>
								<td><input name="State" class="form_input" id="State"
									value="<?php echo $userName["state"]; ?>" type="text"></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
							</tr>

							<tr>
								<td class="tdclass" width="150">Country:<span
									style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
								</td>
								<td><input name="Country" class="form_input" id="Country"
									value="<?php echo $userName["country"]; ?>" type="text"></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
							</tr>
							<tr>
								<td class="tdclass" width="150">Email:<span
									style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
								</td>
								<td><input name="Email" class="form_input" id="Email"
									value="<?php echo $userName["email"]; ?>" type="text"></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
							</tr>

							<tr>
								<td class="tdclass" width="150">User Name:<span
									style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
								</td>
								<td><input name="user_name" class="form_input" id="user_name"
									value="<?php echo $userName["user_name"]; ?>" type="text"></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
							</tr>

							<tr>
								<td class="tdclass" width="150">Password:<span
									style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
								</td>
								<td><input name="password" class="form_input" id="password"
									value="<?php echo $userName["pssword"]; ?>" type="text"></td>
							</tr>
							<tr>
								<td>&nbsp;</td>
							</tr>



							<tr>
							
							
							<tr>
								<td class="tdclass" width="150">Status Edit By User Request:<span
									style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #E60000; padding: 7px;">*</span>
								</td>
								<td><select id="Status" name="Status">
										<option value="active" <?php if ($userName['status']=='active'){echo 'Selected';} ?>>
											Active</option>
										<option value="inactive"
										<?php if ($userName['status']=='inactive'){echo 'Selected';} ?>>
											Inactive</option>
								</select></td>
							</tr>


							<tr>
								<td>&nbsp;</td>
							</tr>

							<tr>
								<td colspan="10" height="58" align="center"><input name="update"
									class="form_input" id="update" value="UPDATE" type="submit">&nbsp;<input
									value="Cancel" class="" onclick="javascript:history.back();"
									type="reset">
								</td>
							</tr>




						</tbody>
					</table>

				</form>
			</td>
		</tr>
	</tbody>






</table>
<script type="text/javascript">
function edituser()
{  
	if(document.getElementById('userName').value=='')
	 {
	 alert("Please Enter Name Of user" );
	 document.getElementById('userName').focus();
	 return false;
	 }
	if(document.getElementById('City').value=='')
	 {
	 alert("Please Enter City" );
	 document.getElementById('City').focus();
	 return false;
	 }
	if(document.getElementById('State').value=='')
	 {
	 alert("Please Enter State " );
	 document.getElementById('State').focus();
	 return false;
	 }
	if(document.getElementById('Country').value=='')
	 {
	 alert("Please Enter Country" );
	 document.getElementById('Country').focus();
	 return false;
	 }
	if(document.getElementById('Email').value=='')
	 {
	 alert("Please Enter Email" );
	 document.getElementById('Email').focus();
	 return false;
	 }
	var em=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/;
	if(!document.form1.Email.value.match(em) )
	  {
	    alert( "Please provide A Valid Email!" );
	    document.form1.Email.focus() ;
	    return false;
	  }
	if(document.getElementById('user_name').value=='')
	 {
	 alert("Please Enter User_Name" );
	 document.getElementById('user_name').focus();
	 return false;
	 }
	if(document.getElementById('password').value=='')
	 {
	 alert("Please Enter Password" );
	 document.getElementById('password').focus();
	 return false;
	 }
	//if(document.getElementById('Status').value=='')
	// {
	// alert("Please Enter User Status" );
	// document.getElementById('Status').focus();
	// return false;
	// }
	//if(document.getElementById('Status').value !=='active' && document.getElementById('Status').value !=='inactive' )
	 //{
	 //alert("Please Enter Status active OR inactive" );
	// document.getElementById('Status').focus();
	// return false;
	// }
	
}
</script>


<div class="clr"></div>
<?php $this->load->view('admin/common/pageFooter');?>
